home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 1 / Cream of the Crop 1.iso / PROGRAM / AEWIN100.ARJ / WINDOW.H < prev    next >
C/C++ Source or Header  |  1991-10-27  |  2KB  |  85 lines

  1. /**********************************************************************
  2.  *  
  3.  *  NAME:           window.h
  4.  *  
  5.  *  DESCRIPTION:    basic window with attribute mapping:
  6.  *                  this is what an app should use, NOT basewin
  7.  *  
  8.  *  copyright (c) 1990 J. Alan Eldridge
  9.  * 
  10.  *  M O D I F I C A T I O N   H I S T O R Y
  11.  *
  12.  *  when        who                 what
  13.  *  -------------------------------------------------------------------
  14.  *  12/??/90    J. Alan Eldridge    created
  15.  *  
  16.  *  12/25/90    JAE                 added interface to winlist.cpp, which
  17.  *                                  keeps a front-to-back list of windows
  18.  *
  19.  *********************************************************************/
  20.  
  21. #ifndef __WINDOW_H
  22. #define __WINDOW_H
  23.  
  24. class Window;
  25.  
  26. extern Window   *findwin(int &y, int &x);
  27.  
  28. #define MAXWNAME    33
  29.  
  30. class Window:
  31.     public  basewin,
  32.     public  attribmap {
  33.  
  34. private:
  35.  
  36.     uchar   name [ MAXWNAME ];   //  name of window (later ...)
  37.     uchar   att;    //  the logical video attribute
  38.  
  39.     vidbuf  save;   //  to save screen before popup
  40.     
  41.     void    newtop();
  42. protected:
  43.     //  let a Window highlight itself according to 
  44.     //  whether it's on top of the list or not ...
  45.     virtual void    activate()
  46.         { touchall(); }
  47.     virtual void    deactivate()
  48.         { }
  49.     
  50. public:
  51.  
  52.     virtual uchar   *isA()
  53.         { return "Window"; }
  54.         
  55.     void    setname(uchar *s);
  56.  
  57.     uchar   *getname()
  58.         { return name; }
  59.                 
  60.     //  constructor
  61.     Window(int yul, int xul, int ylr, int xlr, uchar *name = 0);
  62.         
  63.     //  destructor
  64.     ~Window()
  65.         { unlink(); }
  66.         
  67.     //  position on window list
  68.     int     istop();                    //  is it the front window?
  69.     int     maketop(int show = TRUE);   //  bring window to front of list
  70.     void    unlink();                   //  remove from list
  71.     
  72.     //  video attribute control
  73.     virtual void    setattr(uchar a)
  74.         { att = a; basewin::setattr(getmap(a)); }
  75.     virtual int     getattr()
  76.         { return att; }
  77.  
  78.     //  save, restore screen image (for popups)
  79.     int     savescreen();
  80.     void    restorescreen(int closeit = FALSE);
  81.  
  82. };
  83.  
  84. #endif
  85.